package scmd.team.noone.weatherlivewallpaper.serviceforecast;

public class WeatherInfo {
	public static int MAX_DAY = 5;
	public String cityName;
	public int tempC;
	public String weatherCode;
	public int tempF;
	public int[] tempMax = new int[MAX_DAY], tempMin = new int[MAX_DAY];

	public WeatherInfo() {
		cityName = null;
		tempC = 0;
		tempF = 0;
		weatherCode = null;
	}

	public void setTempC(String temp) {
		this.tempC = Integer.parseInt(temp);
	}
	public void setTempF(String temp) {
		this.tempF = Integer.parseInt(temp);
	}
	public void setTempMax(String[] temp) {
		for (int i = 0; i < MAX_DAY; i++)
		{
			this.tempMax[i] =  Integer.parseInt(temp[i]);
		}
		
	}	public void setTempMin(String[] temp) {
		for (int i = 0; i < MAX_DAY; i++)
		{
			this.tempMin[i] =  Integer.parseInt(temp[i]);
		}
		
	}

	public WeatherInfo(String cityname, String time, String tempC,
			String weatherCode) {
		this.cityName = cityname;
		this.tempC = Integer.parseInt(tempC);
		this.weatherCode = weatherCode;
	}

	public String toString() {
		String temp = "";
		for (int i = 0; i < MAX_DAY; i++) {
			temp += "\nDay " + (i+1);
			temp += " " + tempMax[i] + "/" + tempMin[i];
		}
		return String.format(
							"\nCity: %s" +
							"\nTemp (C): %d" +
							"\nTemp (F): %d" +
							"\nTemp: %s" +
							"\nWeather code: %s",cityName,tempC,tempF,temp,weatherCode);
	}

}
